<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="base" uri="http://qdbp.gitee.io/tags/base/"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<link href="<base:url href='assets/${pv.view}.css'/>" rel="stylesheet" type="text/css" />

<div class="hide x-initial" data-options="{fixedParams:{sceneType:'manager'}}"></div>

<table class="x-treegrid"
		data-options="toolbar:'.toolbar-box',fit:true,border:false,
		method:'POST',url:'<base:url href="actions/resource/list.json"/>',
		fixedParams:{ordering:'sortIndex asc, createTime desc'<shiro:lacksPermission name="root:develop">,state:'NORMAL'</shiro:lacksPermission>},
		idField:'id',parentField:'parentId',treeField:'name', loadFilter:onResourceLoadFilter,
		xextra:{fields:[{field:'Resource',key:'id',value:'name',parent:'parentId'}],map:{Resource:'body'}}, 
		iconMap:{field:'type',cls:'{value}'}">
	<thead>
		<tr>
			<th data-options="field:'name',width:200,align:'left',halign:'center',formatter:format.nameToLink">菜单权限</th>
			<th data-options="field:'operates',width:750,align:'left',halign:'center',formatter:format.operatesToLink">操作权限</th>
		</tr>
	</thead>
</table>


<div class="hide">
	<div class="x-dialog container-fluid" title="创建模块" data-options="xpopup:'create-MODULE',width:500,modal:true,iconCls:'fa fa-th-large'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/create.json'/>">
			<dd>
				<input type="hidden" name="type" value="MODULE" data-clear="false" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">链接地址</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="url" data-options="required:true,validType:['resLinkFormat']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">图标</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.icon" data-options="required:true,validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">颜色</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.color" data-options="validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="创建菜单组" data-options="xpopup:'create-GROUP',width:500,modal:true,iconCls:'fa fa-th-list'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/create.json'/>">
			<dd>
				<input type="hidden" name="type" value="GROUP" data-clear="false" />
				<div class="container-fluid spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属模块</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="editable:false,required:true,validType:['parentType[\'模块\',\'MODULE\']'],xextra:{field:'Resource',ignore:{type:['GROUP','MENU','OPERATE']}},onChange:onParentIdChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">图标</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.icon" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">颜色</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.color" data-options="validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="创建菜单" data-options="xpopup:'create-MENU',width:500,modal:true,iconCls:'fa fa-list'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/create.json'/>">
			<dd>
				<input type="hidden" name="type" value="MENU" data-clear="false" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属菜单组</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="editable:false,required:true,validType:['parentType[\'菜单组\',\'GROUP\']'],onlyLeafSelect:true,xextra:{field:'Resource',ignore:{type:['MENU','OPERATE']}},iconMap:{field:'type',cls:'{value}'},onChange:onParentIdChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">链接地址</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="url" data-options="required:true,validType:['resLinkFormat']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
				</div>
				<%--
				<div class="sub-title">
					<div class="bg">操作信息</div>
				</div>
				<div class="plr-md" data-template="type:'button-edit',params:{total:5}">
					<div class="form-group compact">
						<div class="col-md-3 text-center">KEY</div>
						<div class="col-md-3 text-center">名称</div>
						<div class="col-md-3 text-center">图标</div>
						<div class="col-md-3 text-center">颜色</div>
						<div class="col-md-3 text-center">排序</div>
					</div>
					<div class="form-group compact">
						<div class="col-md-3 text-center"><div class="text-right"></div></div>
						<div class="col-md-3 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].key" data-options="required:true"/></div>
						<div class="col-md-9 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
						<div class="col-md-1 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
						<div class="col-md-3 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
					</div>
				</div>
				--%>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="创建操作权限" data-options="xpopup:'create-OPERATE',width:500,modal:true,iconCls:'fa fa-check-square'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/create.json'/>">
			<dd>
				<input type="hidden" name="type" value="OPERATE" data-clear="false" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属菜单</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="editable:false,required:true,validType:['parentType[\'菜单\',\'MENU\']'],onlyLeafSelect:true,xextra:{field:'Resource',ignore:{type:['OPERATE']}},iconMap:{field:'type',cls:'{value}'},onChange:onParentIdChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true,prompt:'查询 / 创建 / 修改 / 删除 / 导入 / 导出 / ...', onChange:onOperateNameChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="使用场景" data-options="xpopup:'update-SCENE',width:500,modal:true,iconCls:'fa fa-square'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/create.json'/>">
			<dd>
				<input type="hidden" name="type" value="SCENE" data-clear="false" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<shiro:lacksPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
					<shiro:hasPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-5 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
						<div class="col-md-4 control-input">
							<div class="row">
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'disable-confirm'">禁用</a></div>
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'enable-confirm'">启用</a></div>
							</div>
						</div>
					</div>
					</shiro:hasPermission>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<shiro:hasPermission name="root:develop && resource:manager:delete">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',iconCls:'fa fa-minus'">删除</a>
			</shiro:hasPermission>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="模块" data-options="xpopup:'update-MODULE',width:500,modal:true,iconCls:'fa fa-th-large'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/update.json'/>">
			<dd>
				<input type="hidden" name="type" value="MODULE" data-clear="false" />
				<input type="hidden" name="id" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">链接地址</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="url" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resLinkFormat']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">图标</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.icon" data-options="required:true,validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">颜色</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.color" data-options="validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<shiro:lacksPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
					<shiro:hasPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-5 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
						<div class="col-md-4 control-input">
							<div class="row">
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'disable-confirm'">禁用</a></div>
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'enable-confirm'">启用</a></div>
							</div>
						</div>
					</div>
					</shiro:hasPermission>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<shiro:hasPermission name="root:develop">
				<shiro:hasPermission name="resource:manager:delete">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',iconCls:'fa fa-minus'">删除</a>
				</shiro:hasPermission>
			</shiro:hasPermission>
			<shiro:hasPermission name="resource:manager:update">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			</shiro:hasPermission>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="菜单组" data-options="xpopup:'update-GROUP',width:500,modal:true,iconCls:'fa fa-th-list'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/update.json'/>">
			<dd>
				<input type="hidden" name="type" value="GROUP" data-clear="false" />
				<input type="hidden" name="id" />
				<div class="container-fluid spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属模块</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							xextra:{field:'Resource',ignore:{type:['GROUP','MENU','OPERATE']}},onChange:onParentIdChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">图标</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.icon" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">颜色</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="options.color" data-options="validType:['illegalChar']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<shiro:lacksPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
					<shiro:hasPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-5 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
						<div class="col-md-4 control-input">
							<div class="row">
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'disable-confirm'">禁用</a></div>
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'enable-confirm'">启用</a></div>
							</div>
						</div>
					</div>
					</shiro:hasPermission>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<shiro:hasPermission name="root:develop && resource:manager:delete">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',iconCls:'fa fa-minus'">删除</a>
			</shiro:hasPermission>
			<shiro:hasPermission name="resource:manager:update">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			</shiro:hasPermission>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="菜单" data-options="xpopup:'update-MENU',width:500,modal:true,iconCls:'fa fa-list'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/update.json'/>">
			<dd>
				<input type="hidden" name="type" value="MENU" data-clear="false" />
				<input type="hidden" name="id" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属菜单组</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							editable:false,onlyLeafSelect:true,xextra:{field:'Resource',ignore:{type:['MENU','OPERATE']}},iconMap:{field:'type',cls:'{value}'},onChange:onParentIdChange"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">链接地址</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="url" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>
							required:true,validType:['resLinkFormat']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="min:0,max:999999,prompt:'自动排到最后'"/></div>
					</div>
					<shiro:lacksPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
					<shiro:hasPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-5 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
						<div class="col-md-4 control-input">
							<div class="row">
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'disable-confirm'">禁用</a></div>
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'enable-confirm'">启用</a></div>
							</div>
						</div>
					</div>
					</shiro:hasPermission>
				</div>
				<%--
				<div class="sub-title">
					<div class="bg">操作信息</div>
				</div>
				<div class="plr-md" data-template="type:'button-edit',params:{total:5}">
					<div class="form-group compact">
						<div class="col-md-3 text-center">KEY</div>
						<div class="col-md-3 text-center">名称</div>
						<div class="col-md-3 text-center">图标</div>
						<div class="col-md-3 text-center">颜色</div>
						<div class="col-md-3 text-center">排序</div>
					</div>
					<div class="form-group compact">
						<div class="col-md-3 text-center"><div class="text-right"></div></div>
						<div class="col-md-3 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].key" data-options="required:true"/></div>
						<div class="col-md-9 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
						<div class="col-md-1 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
						<div class="col-md-3 text-center"><input class="x-textbox" type="text" name="buttons[<#=i#>].name" data-options="required:true"/></div>
					</div>
				</div>
				--%>
			</dd>
		</form>
		<div class="dialog-button">
			<shiro:hasPermission name="root:develop && resource:manager:delete">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',iconCls:'fa fa-minus'">删除</a>
			</shiro:hasPermission>
			<shiro:hasPermission name="resource:manager:update">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			</shiro:hasPermission>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="操作权限" data-options="xpopup:'update-OPERATE',width:500,modal:true,iconCls:'fa fa-check-square'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/update.json'/>">
			<dd>
				<input type="hidden" name="type" value="OPERATE" data-clear="false" />
				<input type="hidden" name="id" />
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">所属菜单</div>
						<div class="col-md-9 control-input"><input class="x-combotree" type="text" name="parentId" data-options="readonly:true,editable:false,onlyLeafSelect:true,xextra:{field:'Resource',ignore:{type:['OPERATE']}},iconMap:{field:'type',cls:'{value}'},onChange:onParentIdChange"/></div>
					</div>
					<%-- 有无权限顺序不一样,因为可以常用的名称可以自动带出来KEY,名称需要先填 --%>
					<shiro:hasPermission name="root:develop">
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="required:true"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					</shiro:hasPermission>
					<shiro:lacksPermission name="root:develop">
					<div class="form-group">
						<div class="col-md-3 control-label">KEY</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="key" data-options="readonly:true,required:true,validType:['resKeyFormat','resKeySuffix']"/></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">名称</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="name" data-options="readonly:true,required:true"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">排序</div>
						<div class="col-md-9 control-input"><input class="x-numberbox" type="text" name="sortIndex" data-options="
							<shiro:lacksPermission name="root:develop">readonly:true,</shiro:lacksPermission>min:0,max:999999"/></div>
					</div>
					<shiro:lacksPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
					</div>
					</shiro:lacksPermission>
					<div class="form-group">
						<div class="col-md-3 control-label">描述</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="description" data-options="multiline:true,height:60"/></div>
					</div>
					<shiro:hasPermission name="root:develop && resource:manager:state">
					<div class="form-group">
						<div class="col-md-3 control-label">状态</div>
						<div class="col-md-5 control-input"><input class="x-textbox" type="text" name="$state$" data-options="readonly:true,xextra:'SysResState'"/></div>
						<div class="col-md-4 control-input">
							<div class="row">
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'disable-operate',disableWith:{$state$:'DISABLED'}">禁用</a></div>
								<div class="col-md-6 control-input pl-clear"><a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'enable-operate',disableWith:{$state$:'NORMAL'}">启用</a></div>
							</div>
						</div>
					</div>
					</shiro:hasPermission>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<shiro:hasPermission name="root:develop && resource:manager:delete">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',iconCls:'fa fa-minus'">删除</a>
			</shiro:hasPermission>
			<shiro:hasPermission name="resource:manager:update">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save'">保存</a>
			</shiro:hasPermission>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>

	<div class="x-dialog container-fluid" title="禁用" data-options="xpopup:'disable-operate',width:350,modal:true,iconCls:'fa fa-lock'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/disable.json'/>">
			<input type="hidden" name="id" />
			<p class="text-center mtb-xs">
				<span>确定要禁用吗?</span>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save',onSuccess:cascadeClose,message:'禁用'">确定</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="启用" data-options="xpopup:'enable-operate',width:350,modal:true,iconCls:'fa fa-unlock-alt'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/enable.json'/>">
			<input type="hidden" name="id" />
			<p class="text-center mtb-xs">
				<span>确定要启用吗?</span>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-check',onSuccess:cascadeClose,message:'启用'">启用</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="禁用" data-options="xpopup:'disable-confirm',width:350,modal:true,iconCls:'fa fa-lock'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/disable.json'/>">
			<input type="hidden" name="id" />
			<p class="text-center mtb-xs">
				<span class="color-warn">将会级联禁用所有下级节点!</span><br/>
				<span>确定要禁用吗?</span>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save',onSuccess:cascadeClose,message:'禁用'">确定</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="启用" data-options="xpopup:'enable-confirm',width:350,modal:true,iconCls:'fa fa-unlock-alt'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/enable.json'/>">
			<input type="hidden" name="id" />
			<input type="hidden" name="cascade" value="true" data-clear="false" />
			<p class="text-center mtb-xs">
				<span class="color-warn">可选择只启用当前节点或级联启用所有下级节点!</span><br/>
				<span>确定要启用吗?</span>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-check-square-o',fillForm:{cascade:true},onSuccess:cascadeClose,message:'启用'">启用(含下级)</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-check',fillForm:{cascade:false},onSuccess:cascadeClose,message:'启用'">启用(自己)</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="重新加载" data-options="xpopup:'reload-confirm',width:350,modal:true,iconCls:'fa fa-recycle'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/reload.json'/>">
			<p class="text-center mtb-sm">
				<span class="color-warn">重新加载当前用户的权限数据!</span><br/>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-check',message:'加载'">确定</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="x-dialog container-fluid" title="删除" data-options="xpopup:'delete-confirm',width:350,modal:true,iconCls:'fa fa-minus'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/resource/delete.json'/>">
			<input type="hidden" name="id" />
			<input type="hidden" name="cascade" value="true" data-clear="false" />
			<p class="text-center mtb-xs">
				<span class="color-warn">一旦删除将无法恢复!</span><br/>
				<span class="color-warn">将会级联删除所有下级节点!</span><br/>
				<span>确定要删除吗?</span>
			</p>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',iconCls:'fa fa-save',onSuccess:cascadeClose,message:'删除'">确定</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	<div class="toolbar-box">
		<form>
			<div class="toolbar-item">
				<span class="toolbar-text">资源名称:</span><input name="name" class="x-textbox panel-input"/>
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'search',iconCls:'fa fa-search'">查询</a>
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'reset'<%--,iconCls:'fa fa-circle-thin'--%>">重置</a>
				<div class="clear"></div>
			</div>
			<div class="toolbar-item">
				<shiro:hasPermission name="root:develop">
					<shiro:hasPermission name="resource:manager:create">
					<%-- <a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'create-SCENE',fillData:false,iconCls:'fa fa-plus',onAfterFillData:onAfterFillData.create">场景</a> --%>
					<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'create-MODULE',fillData:false,iconCls:'fa fa-plus',onAfterFillData:onAfterFillData.create">模块</a>
					<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'create-GROUP',fillData:false,iconCls:'fa fa-plus',onAfterFillData:onAfterFillData.create">菜单组</a>
					<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'create-MENU',fillData:false,iconCls:'fa fa-plus',onAfterFillData:onAfterFillData.create">菜单</a>
					<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'create-OPERATE',fillData:false,iconCls:'fa fa-plus',onAfterFillData:onAfterFillData.create">操作</a>
					</shiro:hasPermission>
					<shiro:hasPermission name="resource:manager:delete">
					<%-- <a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'delete-confirm',selection:'multi',iconCls:'fa fa-minus',fillData:{id:'ids',i:'.records'}">删除</a> --%>
					</shiro:hasPermission>
				</shiro:hasPermission>
				<shiro:hasPermission name="resource:manager:reload">
				<a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'reload-confirm',iconCls:'fa fa-recycle'">重新加载</a>
				</shiro:hasPermission>
				<shiro:hasPermission name="root:develop">
					<shiro:hasPermission name="resource:manager:import">
					<%-- <a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'import',iconCls:'fa fa-sign-in'">导入</a> --%>
					</shiro:hasPermission>
					<shiro:hasPermission name="resource:manager:export">
					<%-- <a href="javascript:void(0)" class="x-linkbutton" data-options="xpopup:'export',iconCls:'fa fa-sign-out'">导出</a> --%>
					</shiro:hasPermission>
				</shiro:hasPermission>
			</div>
			<div class="clear"></div>
		</form>
	</div>
</div>


<script type="module-list">
	<dd>
		<input type="hidden" name="type" value="MODULE" data-clear="false" />
		<div class="plr-md">
			<div class="form-group compact">
				<div class="col-md-3 text-center">KEY</div>
				<div class="col-md-3 text-center">名称</div>
				<div class="col-md-2 text-center">图标</div>
				<div class="col-md-2 text-center">颜色</div>
				<div class="col-md-2 text-center">排序</div>
			</div>
			<# for (var i = 0; i < this.params.total || 1; i++) { #>
			<div class="form-group compact">
				<div class="col-md-3 text-center"><input class="x-textbox panel-input" type="text" name="key" data-options="required:true"/></div>
				<div class="col-md-3 text-center"><input class="x-textbox panel-input" type="text" name="name" data-options="required:true"/></div>
				<div class="col-md-2 text-center"><input class="x-combobox panel-input" type="text" name="options.icon" data-options="editable:false"/></div>
				<div class="col-md-2 text-center"><input class="x-combobox panel-input" type="text" name="options.color" data-options="editable:false"/></div>
				<div class="col-md-2 text-center"><input class="x-numberbox panel-input" type="text" name="sortIndex" data-options="editable:false"/></div>
			</div>
			<# } #>
		</div>
	</dd>
</script>
<script src="<base:url href='assets/${pv.view}.js'/>"></script>
